# 导入包
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
# 获取浏览器驱动
driver = webdriver.Firefox()
# 1.最大化窗口
driver.maximize_window()
# 打开测试的页面
url = 'file:///root/NSD2408/html/registerA.html'
driver.get(url)

# 2.停顿3秒，设置为指定的大小
# sleep(3)
# driver.set_window_size(400, 1080)
# 3.停顿3秒，设置浏览器在屏幕的指定位置
# sleep(3)
# driver.set_window_position(760, 0)
# 点击进入新浪网
sleep(3)
driver.find_element(By.PARTIAL_LINK_TEXT, '新浪').click()
sleep(3)
# 4.后退
driver.back()
sleep(3)
# 5.前进
sleep(3)
driver.forward()

# 关闭浏览器
sleep(3)
driver.quit()